using abilities.templates;
using LitJson;

namespace abilities
{
    public class Ability
    {
        public string id;
        public string name;
        public string description;
        public string icon;
        public EffectTemplate effect;

        public Ability()
        {
        }

        public bool FromJson(JsonData value)
        {
            id = (string)value["id"];
            name = (string)value["name"];
            description = (string)value["description"];
            icon = (string)value["icon"];
            effect = EffectTemplate.ParseJson(value["effect"]);
            return true;
        }

        private string LocalizedName => Localize.i18n._(name);
        private string LocalizedDescription => Localize.i18n._(description);
        
    }
}